package com.service.impl;

import com.dao.impl.UserDaoImpl;
import com.pojo.User;
import com.service.userService;

public class userServiceImpl implements userService {
    UserDaoImpl dao = new UserDaoImpl();

    @Override
    public void register(User user) {
        dao.SaveUser(user);
    }

    @Override
    public User logUser(User user) {
        return dao.QueryUserByUsernameAndPassword(user.getUsername(), user.getPassword());
    }

    @Override
    public boolean existsUserName(String name) {
        return dao.QueryUserByUsername(name) != null ? true : false;
    }
}